# kinds                                                               -*- sh -*-
#
# For documentation on this file format, please refer to
# src/theory/builtin/kinds.
#

theory THEORY_ARRAYS ::cvc5::internal::theory::arrays::TheoryArrays "theory/arrays/theory_arrays.h"
typechecker "theory/arrays/theory_arrays_type_rules.h"

properties polite stable-infinite parametric
properties check presolve

rewriter ::cvc5::internal::theory::arrays::TheoryArraysRewriter "theory/arrays/theory_arrays_rewriter.h"

operator ARRAY_TYPE 2 "array type"
cardinality ARRAY_TYPE \
    "::cvc5::internal::theory::arrays::ArraysProperties::computeCardinality(%TYPE%)" \
    "theory/arrays/theory_arrays_type_rules.h"
well-founded ARRAY_TYPE \
    "::cvc5::internal::theory::arrays::ArraysProperties::isWellFounded(%TYPE%)" \
    "::cvc5::internal::theory::arrays::ArraysProperties::mkGroundTerm(%TYPE%)" \
    "theory/arrays/theory_arrays_type_rules.h"

enumerator ARRAY_TYPE \
    "::cvc5::internal::theory::arrays::ArrayEnumerator" \
    "theory/arrays/type_enumerator.h"

# select a i  is  a[i]
operator SELECT 2 "array select; first parameter is an array term, second is the selection index"

# store a i e  is  a[i] <= e
operator STORE 3 "array store; first parameter is an array term, second is the store index, third is the term to store at the index"

# eqrange a b i j  \forall k. i <= k <= j -> a[k] = b[k]
operator EQ_RANGE 4 "equality of two arrays over an index range lower/upper"

# storeall t e  is  \all i in indexType(t) <= e
constant STORE_ALL \
    class \
    ArrayStoreAll \
    ::cvc5::internal::ArrayStoreAllHashFunction \
    "expr/array_store_all.h" \
    "array store-all; payload is an instance of the cvc5::internal::ArrayStoreAll class (this is not supported by arrays decision procedure yet, but it is used for returned array models)"

# used internally by array theory
operator ARR_TABLE_FUN 4 "array table function (internal-only symbol)"

# used internally for substitutions in models (e.g. the Boolean terms converter)
# The (single) argument is a lambda(x:T):U.  Type of the array lambda is
# Array T of U.  Thus ARRAY_LAMBDA LAMBDA(x:INT) . (read a x) is the same array
# as a.  ARRAY_LAMBDA LAMBDA(x:INT) . (read a (- x 1)) is the same array as
# as a shifted over one.
operator ARRAY_LAMBDA 1 "array lambda (internal-only symbol)"

typerule SELECT ::cvc5::internal::theory::arrays::ArraySelectTypeRule
typerule STORE ::cvc5::internal::theory::arrays::ArrayStoreTypeRule
typerule STORE_ALL ::cvc5::internal::theory::arrays::ArrayStoreTypeRule
typerule ARR_TABLE_FUN ::cvc5::internal::theory::arrays::ArrayTableFunTypeRule
typerule ARRAY_LAMBDA ::cvc5::internal::theory::arrays::ArrayLambdaTypeRule
typerule EQ_RANGE ::cvc5::internal::theory::arrays::ArrayEqRangeTypeRule

operator PARTIAL_SELECT_0 0:2 "partial array select, for internal use only"
operator PARTIAL_SELECT_1 0:2 "partial array select, for internal use only"
typerule PARTIAL_SELECT_0 ::cvc5::internal::theory::arrays::ArrayPartialSelectTypeRule
typerule PARTIAL_SELECT_1 ::cvc5::internal::theory::arrays::ArrayPartialSelectTypeRule

# store operations that are ordered (by index) over a store-all are constant
construle STORE ::cvc5::internal::theory::arrays::ArrayStoreTypeRule

endtheory
